#!/bin/bash

test1()
{
    dd if=/dev/sda of=/share/tmp/test1.img bs=1M count=10
    ./server -a guest/xss/server/1 &
    ./client -d 0 -a guest/xss/server/1 -l guest/xss/client/1 -f /share/tmp/test1.img -o /share/tmp/test1-new.img &
}

test3()
{
    # Create images
    dd if=/dev/sda of=/share/tmp/test1.img bs=1M count=10
    dd if=/dev/sda of=/share/tmp/test2.img bs=1M count=10
    dd if=/dev/sda of=/share/tmp/test3.img bs=1M count=10
    
    # Start servers
    ./server -a guest/xss/server/1 &
    ./server -a guest/xss/server/2 &
    ./server -a guest/xss/server/3 &
    
    # Start clients
    ./client -d 0 -a guest/xss/server/1 -l guest/xss/client/1 -f /share/tmp/test1.img -o /share/tmp/test1-new.img &
    ./client -d 0 -a guest/xss/server/2 -l guest/xss/client/2 -f /share/tmp/test2.img -o /share/tmp/test2-new.img &
    ./client -d 0 -a guest/xss/server/3 -l guest/xss/client/3 -f /share/tmp/test3.img -o /share/tmp/test3-new.img &
}

#test1
test3
